﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DormMS.IService;

namespace DormMS.Controllers
{
    public class CommonAreaController : BaseController
    {
        protected ICommonAreaService areaservice;
        public CommonAreaController(IUserInfoService s, ICommonAreaService _areaservice) : base(s)
        {
            areaservice = _areaservice;
        }

        // GET: CommonArea
        [HttpPost]
        public ActionResult GetAreaById(int Id)
        {
            return Json(areaservice.GetArea(Id));
        }

        [HttpPost]
        public ActionResult GetArea(string name, int level)
        {
            return Json(areaservice.GetArea(name, level));
        }

        [HttpPost]
        public ActionResult GetAreaList(int parentId)
        {
            return Json(areaservice.GetAreaList(parentId));
        }

        [HttpPost]
        public ActionResult GetAllAreaList()
        {
            return Json(areaservice.GetAreaList());
        }
    }
}